Selection from Read-Only Memory with Limited Workspace

نویسندگان

  • Amr Elmasry
  • Daniel Dahl Juhl
  • Jyrki Katajainen
  • S. Srinivasa Rao
چکیده

Given an unordered array of N elements drawn from a totally ordered set and an integer k in the range from 1 to N , in the classic selection problem the task is to find the k-th smallest element in the array. We study the complexity of this problem in the space-restricted random-access model: The input array is stored on read-only memory, and the algorithm has access to a limited amount of workspace. We prove that the linear-time prune-and-search algorithm— presented in most textbooks on algorithms—can be modified to use Θ(N) bits instead of Θ(N) words of extra space. Prior to our work, the best known algorithm by Frederickson could perform the task with Θ(N) bits of extra space in O(N lg∗N) time. Our result separates the space-restricted random-access model and the multi-pass streaming model, since we can surpass the Ω(N lg∗N) lower bound known for the latter model. We also generalize our algorithm for the case when the size of the workspace is Θ(S) bits, where lgN ≤ S ≤ N . The running time of our generalized algorithm is O(N lg∗(N/S)+N(lgN)/ lgS), slightly improving over the O(N lg∗(N(lgN)/S) +N(lgN)/ lgS) bound of Frederickson’s algorithm. To obtain the improvements mentioned above, we developed a new data structure, called the wavelet stack, that we use for repeated pruning. We expect the wavelet stack to be a useful tool in other applications as well.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Time-Space Trade-Offs for Computing Euclidean Minimum Spanning Trees

In the limited-workspace model, we assume that the input of size n lies in a random access read-only memory. The output has to be reported sequentially, and it cannot be accessed or modified. In addition, there is a read-write workspace of O(s) words, where s ∈ {1, . . . , n} is a given parameter. In a time-space trade-off, we are interested in how the running time of an algorithm improves as s...

متن کامل

Optimal Time-Space Tradeoff for the 2D Convex-Hull Problem

We revisit the read-only random-access model, in which the input array is read-only and a limited amount of workspace is allowed. Given a set of N two-dimensional points in a read-only input array and Θ(S) bits of extra workspace (where S ≥ lgN), we present an algorithm that runs in O(N/S + N lgS) time for constructing the convex hull formed by the given points. Following a lower bound for sort...

متن کامل

Priority Queues and Sorting for Read-Only Data

We revisit the random-access-machine model in which the input is given on a read-only random-access media, the output is to be produced to a write-only sequential-access media, and in addition there is a limited random-access workspace. The length of the input is N elements, the length of the output is limited by the computation itself, and the capacity of the workspace is O(S + w) bits, where ...

متن کامل

Time-Space Trade-offs for Triangulations and Voronoi Diagrams

Let S be a planar n-point set. A triangulation for S is a maximal plane straight-line graph with vertex set S. The Voronoi diagram for S is the subdivision of the plane into cells such that each cell has the same nearest neighbors in S. Classically, both structures can be computed in O(n logn) time and O(n) space. We study the situation when the available workspace is limited: given a parameter...

متن کامل

Time-Space Trade-o s for Triangulations and Voronoi Diagrams

Let S be a planar n-point set. A triangulation for S is a maximal plane straight-line graph with vertex set S. The Voronoi diagram for S is the subdivision of the plane into cells such that each cell has the same nearest neighbors in S. Classically, both structures can be computed in O(n logn) time and O(n) space. We study the situation when the available workspace is limited: given a parameter...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Theor. Comput. Sci.

دوره 554  شماره 

صفحات  -

تاریخ انتشار 2013